﻿#include "frmcomtool.h"
#include "quiwidgetcom.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    a.setWindowIcon(QIcon(":/main.ico"));

    QFont font;
    font.setFamily(ComTool::QUIConfig::FontName);
    font.setPixelSize(ComTool::QUIConfig::FontSize);
    a.setFont(font);

    //设置编码以及加载中文翻译文件
    ComTool::QUIHelper::setCode();
    ComTool::QUIHelper::setTranslator(":/qt_zh_CN.qm");
    ComTool::QUIHelper::setTranslator(":/widgets.qm");
    ComTool::QUIHelper::initRand();

    ComTool::App::Intervals << "1" << "10" << "20" << "50" << "100" << "200" << "300" << "500" << "1000" << "1500" << "2000" << "3000" << "5000" << "10000";
    ComTool::App::ConfigFile = QString("%1/%2.ini").arg(ComTool::QUIHelper::appPath()).arg(ComTool::QUIHelper::appName());
    ComTool::App::readConfig();
    ComTool::App::readSendData();
    ComTool::App::readDeviceData();

    frmComTool w;
    w.setWindowTitle("串口调试助手V2019  QQ: 517216493");
    w.show();

    return a.exec();
}
